import { LinValidator, Rule } from 'lin-mizar';

class ContentSearchValidator extends LinValidator {
  constructor () {
    super();
    this.q = new Rule('isNotEmpty', '必须传入搜索关键字');
  }
}

class CreateOrUpdateContentValidator extends LinValidator {
  constructor () {
    super();
    console.log(">>>>",this)
    this.title = new Rule('isNotEmpty', '必须传入文章名');
    this.description = new Rule('isNotEmpty', '必须传入文章简介');
    this.keywords = new Rule('isNotEmpty', '必须传入关键词');
    // this.cover = new Rule('isLength', '文章插图的url，长度必须在0~100之间', {
    //   min: 0,
    //   max: 100
    // });
  }
}

export { CreateOrUpdateContentValidator, ContentSearchValidator };